# Maintainer: Noel Kuntze <noel.kuntze@contauro.com>
pkgname=grommunio-common
pkgdesc="Common configuration package for grommunio"
pkgver=1.0
pkgrel=0
arch="noarch !riscv64"
url="https://grommunio.com/"
license="AGPL-3.0-only"
options="!check" # No test suite
subpackages="$pkgname-openrc"

source="$pkgname-$pkgver.tar.gz::https://github.com/grommunio/configs/archive/refs/tags/v$pkgver.tar.gz
	0001-redis-grommunio.patch

	grommunio@redis.initd
	grommunio@redis.confd
	"

builddir="$srcdir/configs-$pkgver"

package() {
	mkdir -p "$pkgdir"
	cp -rp -- * "$pkgdir"

	install -dm755 "$pkgdir"/etc/init.d/
	ln -sf "/etc/init.d/redis" "$pkgdir/etc/init.d/grommunio@redis"
	install -Dm644 "$srcdir"/grommunio@redis.confd "$pkgdir"/etc/conf.d/grommunio@redis

	# remove unnecessary files
	rm -rf "$pkgdir/etc/zypp"
}

sha512sums="
1e2db173a73012948be3b829919ab3092ba0399228355d7a157398bb5b4b9d6c4150b1f2aaf38cfb857dba710765408a54cf2aab09e369c28d1971a29f221b26  grommunio-common-1.0.tar.gz
89bad8ea9d28bab8815cf57c8539b49a7d1e59b01409b89539a863e74ca90d8def8a89dc5bed19bf99c0fc38a3ba45707ad33386ed94412403a779e5c71a1831  0001-redis-grommunio.patch
5aa23f4ad715bfc9cf0b8b020b55a3802aedaab0e813250a0fcf50ffa5d792c3c04d1ceb2985cf5d5be71f078b6c5704232ee5a0f891826536f72ba494e57e03  grommunio@redis.initd
1412f11520c5ebce4bdd491e6fe34254fc0e36f79acaae0d1495e77ad2fe799ec6b135d28b92aa68f3486d8ecd329e462230bc2d447aac1353226b8c28b49ccf  grommunio@redis.confd
"
